import axios from 'axios'
import _ from 'lodash'
class getdata {
  getalltunnel() {

    let alllist = {
      sys: {username: 'cjyw', password: 'qhlk_2017'}
    }
    let alltoken = {}

    let allres = {}

    
    // _.forIn(alllist, (item,index) => {
      // return axios.post(`http://192.168.1.220:8080/itsu/logindo?loginName=${item.username}&loginPassword=${item.password}&language=cn&type=oem`).then(res => {
      return axios.post(`http://192.168.1.220:8080/itsu/logindo?loginName=cjyw&loginPassword=qhlk_2017&language=cn&type=oem`).then(res => {
        if (res.code == 1) {
          console.log(res);
          
          alltoken[index] = {token: res.token}
          axios.get(`http://192.168.1.220:8080/itsu/webapi/section/search?index=1&size=10000&type=tunnel&token=${alltoken[index].token}&language=cn`).then(res1 => {
            console.log(res);
            
          })
        }
      })
    // })


  }
}
export default new getdata()